package org.changchen.fgt.controller;

import java.io.IOException;
import java.util.Collections;
import java.util.List;

import org.changchen.fgt.dto.HotVideoDto;
import org.changchen.fgt.service.IqiyiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "/iqiyi")
public class IqiyiController {
	
	
	@Autowired
	private IqiyiService iqiyiService;
	
	
	@GetMapping(value = "/rank")
	@ResponseBody
	public List<HotVideoDto> hotRank(){
		try {
			return iqiyiService.rank(24);
		} catch (IOException e) {
			e.printStackTrace();
			return Collections.emptyList();
		}
	}
	

}
